<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:t="http://myfaces.apache.org/tomahawk">
<body>

<ui:composition template="/WEB-INF/templates/site.xhtml">

<ui:define name="pageTitle">
	#{messages['projectForm.title']}
</ui:define>

<ui:define name="content">

	<style type="text/css">
        .jscalendar-DB-div-style {
            position: absolute;
            margin-top: -69px;
            margin-left: -408px;
        }
	</style>

	<h:messages errorClass="error" layout="table" style="width: 100%"/>
	
	<p>Please fill in project's information below:</p>
	
	<h:form id="projectForm">
		<h:inputHidden value="#{projectForm.project.id}">
		    <f:convertNumber/>
		</h:inputHidden>
		<h:panelGrid columns="1" styleClass="detail" columnClasses="label">
		
		    <h:outputLabel for="name" value="#{messages['project.name']}"/>
		    <h:inputText value="#{projectForm.project.name}" id="name"/>
		    <h:message for="name" styleClass="errorMessage"/>
		
		    <h:panelGroup>
		        <h:commandButton value="Save" action="#{projectForm.save}" id="save" styleClass="button"/>
		    <c:if test="${not empty projectForm.id}">
		        <h:commandButton value="Delete" action="#{projectForm.delete}" id="delete" styleClass="button"/>
		    </c:if>
		        <h:commandButton value="Cancel" action="cancel" immediate="true" id="cancel" styleClass="button"/>
		    </h:panelGroup>
		    <h:inputHidden value=""/>
		</h:panelGrid>
	</h:form>

	<script type="text/javascript">
	    Form.focusFirstElement(document.forms['projectForm']);
	</script>

</ui:define>

<ui:define name="additional">
</ui:define>

</ui:composition>

</body>
</html>